package org.carl.guava.eventbus;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Path;

import com.google.common.eventbus.Subscribe;
import com.google.common.io.Files;

public class FileEchoListener {
	@Subscribe
	public void onListener(Path path) {
		try (BufferedReader br = Files.newReader(path.toFile(), Charset.forName("UTF-8"));) {
			br.lines().forEach(System.out::println);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e1) {
			e1.printStackTrace();
		}
	}
}
